<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html
	class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg no-smil svgclippaths">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>XToolsCRM - easy to Power</title>


<link href="../css/zcss/icons.css" rel="stylesheet" type="text/css">
<link href="../css/zcss/pages.css" rel="stylesheet" type="text/css">
<link href="../css/zcss/responsive.css" rel="stylesheet" type="text/css">
<link href="../css/zcss/sweetalert.min.css" rel="stylesheet"
	type="text/css">
<link href="../css/zcss/custombox.min.css" rel="stylesheet">
<link href="../css/zcss/animate.min.css" rel="stylesheet"
	type="text/css">
<link href="../css/zcss/css.css" rel="stylesheet" type="text/css">

<link href="../css/zcss/bootstrap-datepicker3.min.css" rel="stylesheet">
<link href="../css/zcss/switchery.min.css" rel="stylesheet">
<link href="../css/zcss/bootstrap-clockpicker.min.css" rel="stylesheet">
<link href="../css/zcss/bootstrap-table.min.css" rel="stylesheet"
	type="text/css">
<link href="../css/zcss/bootstrap.min.css" rel="stylesheet"
	type="text/css">
<link href="../css/zcss/bootstrap-select.min.css" rel="stylesheet"
	type="text/css">
<link href="../css/zcss/core.css" rel="stylesheet" type="text/css">
<link href="../css/zcss/components.css" rel="stylesheet" type="text/css">

<!--图标的外部样式-->
<link href="http://cdn.xtcrm.com/cdn//v7/fm/ub/css/icons.css"
	rel="stylesheet" type="text/css">
<!--图标的外部样式-->

<link href="../css/zcss/pages.css" rel="stylesheet" type="text/css">
<link href="../css/zcss/responsive.css" rel="stylesheet" type="text/css">
<link href="../css/zcss/sweetalert.min.css" rel="stylesheet"
	type="text/css">
<link href="../css/zcss/custombox.min.css" rel="stylesheet">
<link href="../css/zcss/animate.min.css" rel="stylesheet"
	type="text/css">
<link href="../css/zcss/css.css" rel="stylesheet" type="text/css">

<script src="http://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!-- 引入样式 -->
<link rel="stylesheet"
	href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script type="text/javascript" src="../js/axios.js"></script>
<script type="text/javascript" src="../js/qs.js"></script>

</head>

<body class="fixed-left modal-open" onload=";">

	<div class="createOrderbox"
		style="width: 800px; height: 100%; margin: 0 auto;"
		id="createOrderbox">
		<el-form :model="ruleForm" :rules="rules" ref="ruleForm"
			class="demo-ruleForm">

		<div id="popshowcont" style="width: 800px; height: 100%;">
			<div id="gedit">
				<div id="editgedit"
					style="position: absolute; display: none; &amp; amp; #9; left: 0; &amp; amp; #9; top: 0; width: 0; &amp; amp; #9; height: 0; z-index: 100; background-color: #D4D0C8;">
					<iframe name="editsubgedit" src="/a.html" scrolling="no"
						style="width: 0; height: 0; border: 0;"></iframe>
				</div>
				<form name="formedit_gedit" class="form-horizontal"
					action="/system/editok.xt" enctype="multipart/form-data"
					method="POST" target="editsubgedit" novalidate=""
					autocomplete="off">
					<input name="mdb" type="hidden"
						value="0c5a3e8915871b710c2cc98073748424"><input
						name="comname" type="hidden" value="gedit"><input
						name="db" type="hidden" value="libin"><input
						name="retjava" type="hidden"
						value="b7gsTKoUGZph2X0lGZld2Xkx2biVnLw9GdgsTKoUGdhRGc1JGZu92XrNWasN2X0lGZldmLw9Gd"><input
						name="type" type="hidden" value="update"><input
						name="dt_libin_id" type="hidden" value="60"><input
						name="dt_libin_bl_flag" type="hidden" value="1">
					<div class="portlet form-horizontal border-n">
						<div class="portlet-heading portlet-default">
							<div class="pull-right  f-s-12">

								<!--<span class="button_close_qshow"><button type="button" class="btn btn-white waves-effect waves-light" data-dismiss="modal" aria-hidden="true"><i class="fa fa-close m-r-5"></i>关闭</button></span>-->
								<div class="btn-save">

									<input name="B0"
										class=" m-l-5 btn btn-white  waves-effect waves-light"
										style="padding-left: 30px" @click="submitForm('ruleForm')"
										type="submit" value="保存" set-lan="value:保存">
								</div>
							</div>
							<h4 class="modal-title text-dark">
								<span set-lan="html:修改入库单">修改入库单</span>

							</h4>
							<hr class="border-t-a">

						</div>
						<div class="gedit_scroll_content">


							<el-row :gutter="20"> <el-col :span="4">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">主题:</div>
							</el-col> <el-col :span="16"> <el-form-item prop="titles">
							<el-input v-model="ruleForm.titles" :span="16"
								placeholder="请输入内容"></el-input> </el-form-item> </el-col> </el-row>

							<!--仓库、填单时间-->
							<el-row :gutter="20"> <!--仓库--> <el-col :span="4">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">仓库:</div>
							</el-col> <!--仓库--> <el-col :span="6" class="dd"> <el-select
								v-model="ruleForm.deport" placeholder="请选择" disabled
								style="width: 220px;"> <el-option
								v-for="item in ruleForm.customertoman" :key="item.dgsnum"
								:label="item.dgsname" :value="item.dgsnum"> </el-option> </el-select> </el-col> <!--仓库-->

							<!--填单时间--> <el-col :span="3">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">填单时间:</div>
							</el-col> <!--填单时间--> <el-col :span="7" class="dd"> <!--<el-input v-model="orderid" :span="16" placeholder="请输入内容"></el-input>-->
							<el-form-item prop="havetime"> <el-date-picker
								v-model="ruleForm.havetime" type="date" placeholder="选择日期"
								:picker-options="pickerOptions0"> </el-date-picker> </el-form-item> </el-col> <!--填单时间-->

							</el-row>

							<!--状态、填单人-->
							<el-row :gutter="20"> <!--状态--> <el-col :span="4">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">状态:</div>
							</el-col> <!--状态--> <el-col :span="6" class="dd"> <el-input
								v-model="ruleForm.types" :span="16" disabled
								style="width: 220px;"></el-input> </el-col> <!--状态--> <!--填单人--> <el-col
								:span="3">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">填单人:</div>
							</el-col> <!--填单人--> <el-col :span="7" class="dd"> <!--<el-input v-model="orderid" :span="16" placeholder="请输入内容"></el-input>-->
							<el-input v-model="ruleForm.domans" :span="16" disabled></el-input>
							</el-col> <!--填单人--> </el-row>

							</br>
							<!--库管确认、执行时间-->
							<el-row :gutter="20"> <!--库管确认--> <el-col :span="4">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">库管确认:</div>
							</el-col> <el-col :span="6" class="dd"> <el-input
								v-model="ruleForm.yesman" :span="16" disabled
								style="width: 220px;"></el-input> </el-col> <!--库管确认--> <!--执行时间--> <el-col
								:span="3">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">执行时间:</div>
							</el-col> <!--执行时间--> <el-col :span="7" class="dd"> <!--<el-input v-model="orderid" :span="16" placeholder="请输入内容"></el-input>-->
							<el-input v-model="ruleForm.dodate" :span="16" disabled></el-input>
							</el-col> <!--填单人--> </el-row>


							</br>

							<!--对应采购单、对应退货单-->
							<el-row :gutter="20"> <!--对应采购单--> <el-col :span="4">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">对应采购单:</div>
							</el-col> <el-col :span="6" class="dd"> <el-input
								v-model="ruleForm.orders" :span="16" disabled
								style="width: 220px;"></el-input> </el-col> <!--对应采购单--> <!--对应退货单--> <el-col
								:span="3">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">退货单:</div>
							</el-col> <!--对应退货单--> <el-col :span="7" class="dd"> <!--<el-input v-model="orderid" :span="16" placeholder="请输入内容"></el-input>-->
							<el-input v-model="ruleForm.retorder" :span="16" disabled></el-input>
							</el-col> <!--对应退货单--> </el-row>

							</br>

							<el-row :gutter="20"> <el-col :span="4">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">对应供应商:</div>
							</el-col> <el-col :span="16"> <el-input
								v-model="ruleForm.suppliers" :span="16" disabled></el-input> </el-col> </el-row>

							</br>
							<el-row :gutter="20"> <el-col :span="4">
							<div
								style="vertical-align: middle; margin-bottom: 0; text-align: right; line-height: 40px; height: 40px;">备注:</div>
							</el-col> <el-col :span="16"> <el-input type="textarea"
								:autosize="{ minRows: 4, maxRows: 5}" placeholder="请输入内容"
								v-model="ruleForm.descins" maxlength="200"> </el-input> </el-col> </el-row>

							</br>

							<div class="row">
								<div class="col-md-12">
									<div class="form-group no-margin">
										<label class="control-label col-md-2">入库明细:</label>
										<div class="FORM-CONTROL_FLAG autogrow col-md-10">
											<div disabled="disabled" class="form-control"
												style="height: inherit; min-height: 36px;">
												<div class="bootstrap-table">
													<div class="fixed-table-container">
														<table class="table table-bordered table-hover"
															id="location_product">
															<thead>
																<tr>
																	<th class="th-inner" style="white-space: nowrap"><span
																		style="font-family: 楷体;">序号</span></th>
																	<th class="th-inner" nowrap="" style="text-align: left"><span
																		style="font-family: 楷体">品名</span></th>
																	<th class="th-inner" nowrap="" style="text-align: left"><span
																		style="font-family: 楷体">型号</span></th>
																	<th class="th-inner" nowrap="" style="text-align: left"><span
																		style="font-family: 楷体">规格</span></th>
																	<th class="th-inner" nowrap=""
																		style="text-align: right"><span
																		style="font-family: 楷体">单位</span></th>
																	<th class="th-inner" nowrap=""
																		style="text-align: right"><span
																		style="font-family: 楷体">入库量</span></th>
																	<th class="th-inner" nowrap="" style="text-align: left"><span
																		style="font-family: 楷体">备注</span></th>
																	<th class="th-inner" style="white-space: nowrap"><span
																		style="font-family: 楷体;">参考库位</span></th>
																</tr>
															</thead>
															<tbody>
																<tr v-for="(colle,i) in thismingx">
																	<td nowrap="">{{i+1}}</td>
																	<td style="text-align: left;">{{colle.goods.gooName}} <a
																		href="javascript:vopen('/xcrm/market/product/detail.xt?id=72','product',999,600);"><i
																			class="fa fa-folder-open m-l-5"
																			data-original-title="打开详细页面" data-toggle="tooltip"
																			data-placement="bottom"></i></a>
																	</td>
																	<td style="text-align: left;">-</td>
																	<td style="text-align: left;">-</td>
																	<td style="text-align: right;">-</td>
																	<td style="text-align: right; white-space: nowrap">{{colle.quatity}}</td>
																	<td style="text-align: left;">{{colle.desc}}</td>
																	<td align="" style="display: none;">&nbsp;</td>
																</tr>
															</tbody>
														</table>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<!--UTF8-->


						</div>

						<div class="text-right p-20">

							<!--<span class="button_close_qshow"><button type="button" class="btn btn-white waves-effect waves-light" data-dismiss="modal" aria-hidden="true"><i class="fa fa-close m-r-5"></i>关闭</button></span>-->
							<div class="btn-save">
								<input name="B0"
									class=" m-l-5 btn btn-white  waves-effect waves-light"
									style="padding-left: 30px" @click="submitForm('ruleForm')"
									type="submit" value="保存" set-lan="value:保存">
							</div>
						</div>
				</form>
			</div>
		</div>

		</el-form>
	</div>
	<script type="text/javascript">
			var vm = new Vue({
				el: ".createOrderbox",
				data: {
					pickerOptions0: {
         				 disabledDate(time) {
           					 return time.getTime() < Date.now() - 8.64e7;
         				 }
       				 }, 
        			thismingx:[],

					ruleForm: {
						/*入库表id*/
						did:"",
						/*主题*/
						titles: "",
						/*仓库*/
						deport: "",
						customertoman: [{
							adid: '选项1',
							adn: '黄金糕'
						}, {
							adid: '选项2',
							adn: '双皮奶'
						}, {
							adid: '选项3',
							adn: '蚵仔煎'
						}, {
							adid: '选项4',
							adn: '龙须面'
						}, {
							adid: '选项5',
							adn: '北京烤鸭'
						}],
						/*填单日期*/
						havetime: "",
						/*状态*/
						types: "",
						/*填单人*/
						domans: "",
						/*库管确认*/
						yesman: "",
						/*执行时间*/
						dodate: "",
						/*对应采购单*/
						orders: "",
						/*对应退货单*/
						retorder: "",
						/*对应供应商*/
						suppliers: "",
						/*备注*/
						descins: "",
						/*入库明细*/
						indetails: ""
					},
					rules: {
						//数据源model
						titles: [
							//非空验证
							{
								required: true,
								message: '请输入获客主题',
								trigger: 'blur'
							},
							//长度验证
							{
								min: 3,
								max: 15,
								message: '长度在 3 到 15 个字符',
								trigger: 'blur'
							}
						],
						deport: [{
							required: true,
							message: '请选择仓库',
							trigger: 'change'
						}],
						havetime: [
							//数据类型要是date
							{
								type: 'date',
								required: true,
								message: '请选择日期',
								trigger: 'change'
							}
						]
					}

				},
				methods: {
					submitForm(formName) {
						//alert("sss");
						//验证方法
						this.$refs[formName].validate((valid) => {
							if(valid) {
								//post提交数据
								axios.post("/updateinstockes",
									//参数转换
									Qs.stringify(this.ruleForm, {
										arrayFormat: 'brackets'
									})
									
								).then(function(v) {
									window.parent.location.href="/instockes";
								}).catch(function(e) {
									alert("出错了"+e);
								});

							} else {
								console.log('error submit!!');
								return false;
							}
						});
					}
				},mounted() {
					var sheslfse=${shelfs};
					this.ruleForm.customertoman=sheslfse;
					
					var textInstock=${textInstock};
					this.ruleForm.did=textInstock.innum;
					this.ruleForm.titles=textInstock.theme;
					this.ruleForm.deport=textInstock.dgsnum;
					if (textInstock.tdate!=null) {
						this.ruleForm.havetime = new Date(textInstock.tdate);  
					}
					
					this.ruleForm.types=textInstock.dic_name;
					this.ruleForm.domans=textInstock.use_name;
					if (textInstock.intype==3021) {
						this.ruleForm.yesman="确认完毕";
					}
					this.ruleForm.descins=textInstock.indesc;
					this.ruleForm.dodate =textInstock.Idate;  
					
					this.ruleForm.orders=textInstock.theme2;
					this.ruleForm.suppliers=textInstock.supname;
					//this.ruleForm.customertoman=textInstock;
					console.log(textInstock.indesc);

					var thisjson=${CartBoxInthisJson};
					this.thismingx = thisjson.map;
				}
				

			});
		</script>

</body>
<!--UTF8-->

</html>